//
//  singerSongCell.m
//  A段项目音乐播放
//
//  Created by 太阳 on 15/5/23.
//  Copyright (c) 2015年 lanou3g.com蓝鸥科技. All rights reserved.
//

#import "singerSongCell.h"
#import "myButton.h"
@implementation singerSongCell
- (void)dealloc
{
    [_photoimage release];
    [_mybutton release];
    [_singername release];
    [_collectButton release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self builtinterface];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}
- (void)builtinterface
{
    self.photoimage = [[UIImageView alloc]initWithFrame:CGRectMake(5, 5, 50, 50)];
    [self.photoimage setBackgroundColor:[UIColor yellowColor]];
    [self.contentView addSubview:self.photoimage];
    [self.photoimage release];
    
    self.mybutton = [[myButton alloc]initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width - 50 - 5, 5, 50, 50)];
    [self.mybutton setTitle:@">" forState:UIControlStateNormal];
    [self.mybutton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.mybutton setBackgroundColor:[UIColor colorWithRed:0.3 green:1 blue:1 alpha:1]];
    [self.mybutton addTarget:self action:@selector(buttonaction:) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:self.mybutton];
    
    
    self.singername = [[[UILabel alloc]initWithFrame:CGRectMake(80, 8, 100, 30)] autorelease];
    self.singername.textColor = [UIColor colorWithWhite:0.3 alpha:1];
    self.singername.userInteractionEnabled =YES;
    [self.contentView addSubview:self.singername];
    self.collectButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [self.collectButton setBackgroundColor:[UIColor colorWithRed:0.3 green:1 blue:1 alpha:1]];
    self.collectButton.frame = CGRectMake([UIScreen mainScreen].bounds.size.width - 55, 5, 60, 50);
    
    
    
    
    [self.contentView addSubview:self.collectButton];

    
    
    
}
- (void)buttonaction:(myButton *)btn
{
    
//    UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 50, [UIScreen mainScreen].bounds.size.width, 50)];
//    [view setBackgroundColor:[UIColor greenColor]];
//    [self.contentView addSubview:view];
    [self.delegate cellaction:btn];
    
}

- (void)awakeFromNib {
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
